//
//  ViewController.m
//  PictureShower
//
//  Created by 宫 酉昊 on 15/6/2.
//  Copyright (c) 2015年 宫 酉昊. All rights reserved.
//

#import "ViewController.h"
#import "PictureShower.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UIImage *demoImage = [UIImage imageNamed:@"TestImage.jpg"];
    self.demoImageView = [[UIImageView alloc] initWithImage:demoImage];
    CGFloat width = 220/2;
    CGFloat height = 220/2;
    self.demoImageView.frame = CGRectMake(([UIScreen mainScreen].bounds.size.width - width)/2,
                                     ([UIScreen mainScreen].bounds.size.height - height)/2,
                                     width,
                                     height);
    [self.view addSubview:self.demoImageView];
    
    //使用实例
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showThePicture:)];
    [self.demoImageView addGestureRecognizer:tapGesture];
    self.demoImageView.userInteractionEnabled = YES;
    
}

- (void)showThePicture:(UIGestureRecognizer*)tap{
    [PictureShower showImage:self.demoImageView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
